/*
 * Copyright (c) 2014, FPX and/or its affiliates. All rights reserved.
 * Use, Copy is subject to authorized license.
 */
package pyip.lib.javalearn.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * 切入所有的Mapper方法
 * @author shiw
 *         2014年12月15日
 */
//@Component
@Aspect
public class MapperAspect  {
    
    //@Pointcut("execution(* pyip.lib.javalearn.aspect.HelloWorld.*(..))")
    @Pointcut("execution(* pyip.lib.javalearn.aspect.HelloWorld.*())")
    private void anyMethod() {
    }

    @Around("anyMethod()")
    public Object Around(ProceedingJoinPoint jp) {
        try {
            System.out.println("aspect");
            return jp.proceed();
        } catch (Throwable e) {
            throw new RuntimeException("天空很美");
        }
    }
}
